<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('打印信息')"/>
    <link th:href="@{/css/print.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div id="qrcode">
    <div class = "split" th:each="tOrder,tOrderStat : ${tOrders}">
        <div class="ibox-title">
            <h3 class="text-center">南京画廊拍卖有限公司销售单</h3>
        </div>
                    <p>客户名称: <span th:text="${tOrder.receiver}"></span></p>
                    <p>销售时间: <span th:text="${#dates.format(tOrder.orderTime, 'yyyy-MM-dd')}"></span></p>
                    <p>销售单号: <span th:text="${tOrder.orderNo}"></span></p>
                <table class="table table-condensed "  style="margin-bottom: 5px;">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>名称</th>
                        <th>规格</th>
                        <th>数量</th>
                        <th>单位</th>
                        <th>单价</th>
                        <th>金额</th>
                        <th>备注</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="tOrderDetail ,odStatus: ${tOrder.tOrderDetailList}">
                        <td th:text="${odStatus.index+1}"></td>
                        <td th:text="${tOrderDetail.goodsName}"></td>
                        <td th:text="${tOrderDetail.spec}"></td>
                        <td th:text="${tOrderDetail.quantity}"></td>
                        <td th:text="${tOrderDetail.unit}"></td>
                        <td th:text="${tOrderDetail.price}"></td>
                        <td th:text="${tOrderDetail.price}"></td>
                        <td th:text="${tOrderDetail.comment}"></td>
                    </tr>
                    <tr th:switch="${tOrder.payWay}">
                        <td></td>
                        <td colspan="5" th:case="'0'">货到付款</td>
                        <td colspan="5" th:case="*">已付款</td>
                        <td th:text="'¥'+${tOrder.amount}"></td>
                        <td th:text="${tOrder.comment}"></td>
                    </tr>
                    </tbody>
                </table>
                    <p>地址：南京市江宁区东山街道金源路2号南广场绿地城际空间D1-1407</p>
    </div>
    </div>
    <!--<button type="button" id="btn_print" class="btn btn-primary" data-dismiss="modal">-->
    <!--<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>打印-->
    <!--</button>-->
</div>
</body>
<th:block th:include="include :: footer"/>
<script>

    function submitHandler() {
        /* Act on the event */
        $("#qrcode").printThis({
            debug: false,
            importCSS: false,
            importStyle: false,
            printContainer: true,
            loadCSS: ["/css/print.css","/css/style.css", "/css/bootstrap.min.css" ],
            pageTitle: "订单打印",
            removeInline: false,
            printDelay: 333,
            header: null,
            formValues: false
        });
//  alert("等待打印");
    }

</script>
</html>
